<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	    		xmlns:ui="http://java.sun.com/jsf/facelets"
	  			xmlns:h="http://java.sun.com/jsf/html"
	  			xmlns:f="http://java.sun.com/jsf/core"
                xmlns:s="http://jboss.com/products/seam/taglib"
      			xmlns:rich="http://richfaces.org/rich"
      			xmlns:c="http://java.sun.com/jstl/core"
				xmlns:a4j="http://richfaces.org/a4j">
				
<br/>				
	
	<s:div id="conteudoGeral" styleClass="forms" style="width: 95%">
		<a4j:outputPanel>
		
		<div class="formCenter prefix_1 grid_14">
            <h1>Dados Consulta</h1>
            <fieldset>
            	<legend>Dados Consulta</legend>
                <ul>
                    <li>
                    	<label class="grid_3">Nome Paciente:</label>
                        <div class="grid_10">
                        	<h:selectOneMenu value="#{consultaAction.paciente.id}">
                        		<s:selectItems value="#{pacienteAction.pacientes}" var="paciente" label="#{paciente.nome}" itemValue="#{paciente.id}" noSelectionLabel="Selecione um paciente..."></s:selectItems>
                        	</h:selectOneMenu>
                        </div>
                    </li>
                    <li>
                    	<label class="grid_3">Data/Hora Consulta:</label>
                        <div class="grid_10">
                     		<rich:calendar id="dtConsulta" value="#{consulta.dataConsulta}" datePattern="d/M/yy HH:mm"></rich:calendar>
                     		<rich:message for="dtConsulta">
		                        <f:facet name="errorMarker">
		                            <h:graphicImage value="/img/error.gif" />   
		                        </f:facet>
		                    </rich:message>
                        </div>
                    </li>
                    <li>
                    	<label class="grid_3">Observações:</label>
                        <div class="grid_8">
                        	<h:inputTextarea id="campoObs" value="#{consulta.observacoes}" />
                        	<rich:message for="campoObs">
		                        <f:facet name="errorMarker">
		                            <h:graphicImage value="/img/error.gif" />   
		                        </f:facet>
		                    </rich:message>
                        </div>
                    </li>
             	</ul>
             </fieldset>
        </div>
        
        <div>
        	<p class="txtCO">Campos Obrigatórios<span>*</span></p>
            <div class="btnAcoes2">
            	<a4j:commandButton action="#{consultaAction.salvarConsulta}" value="Salvar" reRender="listConsultas">
            	</a4j:commandButton>
            	
            </div>
        </div>
		</a4j:outputPanel>
		
	</s:div>
	
	<rich:modalPanel id="panel_loading" autosized="true">
			<h:graphicImage url="/img/loading.gif" style="border:0px; vertical-align: middle;" />
				<rich:spacer width="20" /><br/>
				<h:outputText value="Carregando... Aguarde!" />
	</rich:modalPanel>
</ui:composition>